//
//  AccountService.m
//  ZYWL
//
//  Created by lcy on 16/1/6.
//  Copyright © 2016年 ruiyun. All rights reserved.
//

#import "AccountService.h"
#import "ResultModel.h"
#import "RegistModel.h"
@implementation AccountService
+(instancetype)getObject
{
    return [[AccountService alloc] init];
}
//获取验证码
- (void)getCheckCode:(NSString *)phone
{
    self.reponseType = TYPE_OBJECT;
    NSString *host =HOST;
    _hostUrl = [host stringByAppendingString:[NSString stringWithFormat:@"getCheckCode.do"]];
    NSDictionary *dict = @{@"phone":phone};
    NSString *data = [TypeConversion jsonStringWithDictionary:dict];
    _paramDict = @{@"params":data};
    _modelclass = [ResultModel class];
    [self startPostRequest];
}
//用户注册
-(void)regMember:(NSString *)phone passw:(NSString *)passw{
//    self.reponseType = TYPE_OBJECT;
    NSString *host =HOST;
    _hostUrl = [host stringByAppendingString:[NSString stringWithFormat:@"regMember.do"]];
    NSDictionary *dict = @{@"phone":phone,@"password":passw};
    NSString *data = [TypeConversion jsonStringWithDictionary:dict];
    _paramDict = @{@"params":data};
    _modelclass = [RegistModel class];
    [self startPostRequest];

}
//用户登录
-(void)login:(NSString *)phone passw:(NSString *)passw{
    self.reponseType = TYPE_OBJECT;
    NSString *host =HOST;
    _hostUrl = [host stringByAppendingString:[NSString stringWithFormat:@"login.do"]];
    NSDictionary *dict = @{@"phone":phone,@"password":passw};
    NSString *data = [TypeConversion jsonStringWithDictionary:dict];
    _paramDict = @{@"params":data};
    _modelclass = [RegistModel class];
    [self startPostRequest];

}
@end
